
const loadingImg = (src) => {
  return new Promise((resolve, reject) => {
    const img = new Image()
    img.onload = () => {
      resolve(true)
    }
    img.onerror = () => {
      reject(false)
    }
    img.src = src;
  })
}

const realImg = async (src) => {
  const imgFlag = await loadingImg(src)
  return imgFlag
}

console.log(realImg('http://dummyimage.com/375x200/79f299&text=南平市'))